<?php
namespace app\api\route;
use think\facade\Route;
use app\api\middleware\Auth;
use app\api\validate\company\Examine;
Route::get('company/info', 'company.Company/index')->middleware([Auth::class]);
Route::get('company/teamClass', 'company.Team/classList')->middleware([Auth::class]);
Route::get('company/department', 'company.Department/lists')->middleware([Auth::class]);
Route::get('company/teams', 'company.Team/list')->middleware([Auth::class]);
Route::get('company/team/:id', 'company.Team/info')->middleware([Auth::class]);
Route::get('company/staffs', 'company.Staff/list')->middleware([Auth::class]);
Route::get('company/stations/:department_id', 'company.Station/list')->middleware([Auth::class]);
Route::get('company/files', 'company.File/list')->middleware([Auth::class]);
Route::post('company/addFile', 'company.File/addFile')->middleware([Auth::class]);

Route::group("interview", function () {
    Route::get('lists', route: 'company.Interview/lists');
    Route::post('save', route: 'company.Interview/save');
    Route::get('form/:id', route: 'company.Interview/form');
    Route::get(':id', route: 'company.Interview/info');
    Route::post('saveLog', route: 'company.Interview/saveLog');
    Route::post('offer/:id', route: 'company.Interview/offer');
})->middleware([Auth::class]);

Route::group("train", function () {
    Route::get('file', route: 'company.Train/file');
    Route::get('isTrainer', route: 'company.Train/isTrainer');
    Route::get('form/:id', route: 'company.Train/form');
    Route::get('students', 'company.Train/students');        //列表
    Route::get('detail/:user_id', route: 'company.Train/detail');
    Route::get('logs', route: 'company.Train/logs');
    Route::get(':id', route: 'company.Train/info');
    Route::post('saveFile', route: 'company.Train/saveFile');
    Route::post('offer/:id', route: 'company.Train/offer');
    Route::post('saveLog', route: 'company.Train/saveLog');
})->middleware([Auth::class]);

Route::group("examine", function () {
    Route::get('list', route: 'company.Examine/lists');
    Route::get('logs', route: 'company.Examine/logs')->validate(Examine::class,'logs');
    Route::get('is_manager/:examine_id', route: 'company.Examine/is_manager')->validate(Examine::class,'logs');
    Route::post('save', route: 'company.Examine/save');
    Route::post('addLog', route: 'company.Examine/addLog')->validate(Examine::class,'addLog');
    Route::post('saveLog', route: 'company.Examine/saveLog')->validate(Examine::class,'saveLog');
    Route::get('report', route: 'company.Examine/report');
    Route::post('addReport', route: 'company.Examine/addReport')->validate(Examine::class,'addReport');
    Route::get('reportTpl', route: 'company.Examine/reportTpl');
    Route::post('addReportTpl', route: 'company.Examine/addReportTpl')->validate(Examine::class,'addReportTpl');
    Route::post('editReport', route: 'company.Examine/editReport')->validate(Examine::class,'editReport');
    Route::get('reportInfo/:id', route: 'company.Examine/reportInfo');
    Route::get(':id', route: 'company.Examine/info');
})->middleware([Auth::class]);